package com.gzhryc.shared_device.bxscn.code.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.bxscn.code.dao.enums.PortableEnergyCabinetSlotEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * 便携式储能充电柜舱室
 * @version 2023-08-28
 */
@Table(name = "dev_portable_energy_cabinet_slot")
public class PortableEnergyCabinetSlot implements Serializable {

    private static final long serialVersionUID = 1L;

	@PrimaryKey
    @Column(notNull = true, name = "device_sn")
    protected String deviceSn;

    @PrimaryKey
    @Column(notNull = true, name = "slot_num")
    protected Integer slotNum;

    @Column(name = "portable_battery_sn", note = "充电宝序列号")
    protected String portableBatterySn;

    @Column(notNull = true, defVal = "1", note = "卡槽状态")
    protected Integer state;

    @Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
    protected Date updateDate;

    @Column(name = "create_date",notNull = true)
    protected Date createDate;

    @Join(fromField = "portable_battery_sn", toField = "device_sn", type = "LEFT")
    protected PortableEnergyBattery portableBattery;

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public Integer getSlotNum() {
        return slotNum;
    }

    public void setSlotNum(Integer slotNum) {
        this.slotNum = slotNum;
    }

    public String getPortableBatterySn() {
        return portableBatterySn;
    }

    public void setPortableBatterySn(String portableBatterySn) {
        this.portableBatterySn = portableBatterySn;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public PortableEnergyBattery getPortableBattery() {
        return portableBattery;
    }

    public void setPortableBattery(PortableEnergyBattery portableBattery) {
        this.portableBattery = portableBattery;
    }

    public String getStateName(){
        return PortableEnergyCabinetSlotEnum.State.note(this.state);
    }
}
